//
//  YLMallGoodDetailTitleCell.m
//  YLFinanceService
//
//  Created by she1323 on 2017/9/6.
//  Copyright © 2017年 she1323. All rights reserved.
//  产品详情

#import "YLMallGoodDetailTitleCell.h"
#import "YLMallGoodModel.h"
#import "YLGlobeHeader.h"
@interface YLMallGoodDetailTitleCell()
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *neetPointLabel;
@property (weak, nonatomic) IBOutlet UILabel *leftNumberLabel;
@property (weak, nonatomic) IBOutlet UILabel *productNameLabel;
@end

@implementation YLMallGoodDetailTitleCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(YLMallGoodModel *)model
{
    _model = model;
    _productNameLabel.text = model.pointProductName;
    _leftNumberLabel.text = [NSString stringWithFormat:@"剩余%zd份", model.amountIndex];
    _neetPointLabel.text = [NSString stringWithFormat:@"%@积分", model.neetPoint];
    _priceLabel.text = [NSString stringWithFormat:@"市场价:￥%@", model.price];
     NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:model.neetPoint attributes:@{NSForegroundColorAttributeName : YLMainColor}];

    [attStr appendAttributedString:[[NSAttributedString alloc] initWithString:@" 积分" attributes:@{NSForegroundColorAttributeName : [UIColor blackColor]}]];
    
    _neetPointLabel.attributedText = attStr;
    
    
}

//- (NSAttributedString *)agreementAttributedString
//{
//
//
//    return attStr;
//}

+ (NSString *)cellID
{
    return @"YLMallGoodDetailTitleCell";
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
